<?php
/**
 * Created by PhpStorm
 * User: Jhinwy
 * Date: 6/6/24
 * Time: 1:53 PM
 */

namespace App\Services;

use App\Models\WechatAccountCustomer;

class CustomerService
{
    /**
     * 获取客户列表
     *
     * @param $params
     * @return \Illuminate\Database\Eloquent\Builder[]|\Illuminate\Database\Eloquent\Collection
     */
    public function getCustomerList($params)
    {
        $corpId = $params['corp_id'] ?? '';
        $userId = $params['user_id'] ?? '';

        return WechatAccountCustomer::query()
            ->select('id', 'corp_id', 'account_id', 'customer_id', 'customer_name', 'avatar', 'gender', 'customer_type', 'add_time', 'add_way')
            ->where('corp_id', $corpId)
            ->where('account_id', $userId)
            ->get();
    }
}
